import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询应急卡列表
export function listEmergency(query) {
  return request({
    url: '/aqsc/emergency/list',
    method: 'get',
    params: query
  })
}

// 查询应急卡详细
export function getEmergency(emergencyId) {
  return request({
    url: '/aqsc/emergency/' + parseStrEmpty(emergencyId),
    method: 'get'
  })
}

// 新增应急卡
export function addEmergency(data) {
  return request({
    url: '/aqsc/emergency',
    method: 'post',
    data: data
  })
}

// 修改应急卡
export function updateEmergency(data) {
  return request({
    url: '/aqsc/emergency',
    method: 'put',
    data: data
  })
}

// 删除应急卡
export function delEmergency(emergencyId) {
  return request({
    url: '/aqsc/emergency/' + emergencyId,
    method: 'delete'
  })
}

// 批量删除应急卡
export function dels(data) {
  return request({
    url: '/aqsc/emergency/dels',
    method: 'delete',
    params: data
  })
}

// 查询负责人列表
export function queryUsers(data) {
  return request({
    url: '/aqsc/emergency/userInfo',
    method: 'get',
    params: data
  })
}

// 根据应急卡userId查询负责人信息
export function queryUser(userId) {
  return request({
    url: '/aqsc/emergency/userDetail/' + userId,
    method: 'get'
  })
}

// 查询岗位列表
export function queryPosts(data) {
  return request({
    url: '/aqsc/emergency/postList',
    method: 'get',
    data: data
  })
}

// 查询部门列表
export function queryDepts(data) {
  return request({
    url: '/aqsc/emergency/deptList',
    method: 'get',
    data: data
  })
}

// 根据应急卡postId查询负责人信息
export function queryPost(postId) {
  return request({
    url: '/aqsc/emergency/pDetail/' + postId,
    method: 'get'
  })
}


//  风险分区
export function queryRisks(data) {
  return request({
    url: '/aqsc/emergency/riskList',
    method: 'get',
    data: data
  })
}

// 根据应急卡postId查询负责人信息
export function queryRisk(regionId) {
  return request({
    url: '/aqsc/emergency/rDetail/' + regionId,
    method: 'get'
  })
}




